Deriving Animations from Recursive Definitions
نویسندگان
چکیده
This paper describes a generic method to derive an animation from a recursive definition, with the objective of debugging and understanding this definition by expliciting its control structure. This method is based on a well known algorithm of factorizing a recursive function into the composition of the producer and the consumer of its call tree. We developed a systematic method to transform both the resulting functions in order to draw the tree step by step. The theory of data types as fixed points of functors, generic recursion patterns, and monads, are fundamental to our work and are briefly presented. Using polytypic implementations of monadic recursion patterns and an application to manipulate and generate graph layouts we developed a prototype that, given a recursive function written in a subset of Haskell, returns a function whose execution yields the desired animation.
منابع مشابه
Non-primitive Recursive Function Definitions
This paper presents an approach to the problem of introducing non-primitive recursive function definitions in higher order logic. A recursive specification is translated into a domain theory version, where the recursive calls are treated as potentially non-terminating. Once we have proved termination, the original specification can be derived easily. A collection of algorithms are presented whi...
متن کاملCharacterising and matching iterative and recursive agent interaction protocols
For an agent to intelligently use specifications of executable protocols, it is necessary that the agent can quickly and correctly assess the outcomes of that protocol if it is executed. In some cases, this information may be attached to the specification; however, this is not always the case. In this paper, we present an algorithm for deriving characterisations of protocols. These characterisa...
متن کاملInfoVis Interaction Techniques in Animation of Recursive Programs
Algorithm animations typically assist in educational tasks aimed simply at achieving understanding. Potentially, animations could assist in higher levels of cognition, such as the analysis level, but they usually fail in providing this support because they are not flexible or comprehensive enough. In particular, animations of recursion provided by educational systems hardly support the analysis...
متن کاملRank 2 Intersection for Recursive Definitions
Let ` be an intersection type system. We say that a term is `-simple (or just simple when the system ` is clear from the context) if system ` can prove that it has a simple type. In this paper we propose new typing rules and algorithms that are able to type (with rank-2 intersection types) recursive definitions that are not simple. Typing rules for assigning intersection types to (nonsimple) re...
متن کاملAutomatic Generation of Generalization Lemmas for Proving Properties of Tail-Recursive Definitions
Automatically proving properties of tail-recursive function definitions by induction is known to be challenging. The difficulty arises due to a property of a tail-recursive function definition typically expressed by instantiating the accumulator argument to be a constant only on one side of the property. The application of the induction hypothesis gets blocked in a proof attempt. Following an a...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2002